1600
|
How do I set a computated cell individually

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Format")
oItems := oG2antt:Items()
h := oItems:AddItem("1.23")
oItems:SetProperty("CellValueFormat",h,1,2/*exComputedField*/)
oItems:SetProperty("CellValue",h,1,"2 * %0 + ` (2 * Number)`")
h := oItems:AddItem("1.23")
oItems:SetProperty("CellValueFormat",h,1,2/*exComputedField*/)
oItems:SetProperty("CellValue",h,1,"3 * %0 + ` (3 * Number)`")
h := oItems:AddItem("1.23")
oItems:SetProperty("CellValueFormat",h,1,2/*exComputedField*/)
oItems:SetProperty("CellValue",h,1,"currency(%0) + ` ( Currency(Number) )`")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1599
|
How can I hide a specific hour
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms,oInsideZooms1
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:DrawGridLines := -1/*exAllLines*/
oG2antt:Columns():Add("Default")
oChart := oG2antt:Chart()
oChart:AllowInsideZoom := .T.
oChart:FirstWeekDay := 1/*exMonday*/
oChart:FirstVisibleDate := "03/31/2013"
oChart:SetProperty("PaneWidth",.F.,52)
oChart:LevelCount := 2
oChart:UnitScale := 65536/*exHour*/
oChart:Level(1):Label := "<font ;6><%h%></font>"
oChart:UnitWidth := 14
oChart:DrawGridLines := -1/*exAllLines*/
oChart:AllowInsideZoom := .T.
oChart:DefaultInsideZoomFormat():InsideUnit := 1048576/*exMinute*/
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:DefaultWidth := 0
oInsideZooms1 := oChart:InsideZooms()
oInsideZooms1:Add("03/31/2013 23:00:00")
oItems := oG2antt:Items()
oItems:AddItem("Item")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1598
|
Is it possible to define the keys of the drop down values to be strings rather than numeric values
PROCEDURE OnChange(oG2antt,Item,ColIndex,NewValue)
DevOut( "NewValue is" )
DevOut( Transform(NewValue,"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor,oEditor1
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Change := {|Item,ColIndex,NewValue| OnChange(oG2antt,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/
oEditor := oG2antt:Columns():Add("DropDownList-String"):Editor()
oEditor:EditType := 3/*DropDownListType*/
oEditor:AddItem(1,"NYC|New York City")
oEditor:AddItem(2,"CJN|Cluj Napoca")
oEditor1 := oG2antt:Columns():Add("DropDownList-Numeric"):Editor()
oEditor1:EditType := 3/*DropDownListType*/
oEditor1:AddItem(1,"New York City")
oEditor1:AddItem(2,"Cluj Napoca")
oItems := oG2antt:Items()
oItems:SetProperty("CellValue",oItems:AddItem("NYC"),1,2)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1597
|
I have an edit field, when going to edit mode, the rightmost part is shown. Is it possible to show the left part instead

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oEditor
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oColumn := oG2antt:Columns():Add("Edit")
oColumn:Width := 64
oColumn:AllowSizing := .F.
oEditor := oColumn:Editor()
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := ";;;rich"
oG2antt:Columns():Add("Empty")
oItems := oG2antt:Items()
oItems:AddItem("This is a bit ot long text")
oItems:AddItem("")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1596
|
I have a drop down field, the control shows the rightmost part of the selected caption. Is it possible to show the left part
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1
LOCAL oEditor,oEditor1,oEditor2,oEditor3
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oColumn := oG2antt:Columns():Add("DropDown")
oColumn:Width := 64
oColumn:AllowSizing := .F.
oEditor := oColumn:Editor()
oEditor:DropDownAlignment := 32/*0x20+*/
oEditor:EditType := 2/*DropDownType*/
oEditor:AddItem(1,"First item. This is a bit ot long text")
oEditor:AddItem(2,"Second item. This is a bit ot long text")
oEditor:AddItem(3,"Third item. This is a bit ot long text")
oEditor:Mask := ";;;rich"
oColumn1 := oG2antt:Columns():Add("PickEdit")
oColumn1:Width := 64
oColumn1:AllowSizing := .F.
oEditor1 := oColumn1:Editor()
oEditor1:DropDownAlignment := 32/*0x20+*/
oEditor1:EditType := 14/*PickEditType*/
oEditor1:AddItem(1,"First item. This is a bit ot long text")
oEditor1:AddItem(2,"Second item. This is a bit ot long text")
oEditor1:AddItem(3,"Third item. This is a bit ot long text")
oEditor1:Mask := ";;;rich"
oG2antt:Columns():Add("Empty")
oItems := oG2antt:Items()
oItems:SetProperty("CellValue",oItems:AddItem("First item. This is a bit ot long text"),1,"Second item. This is a bit ot long text")
h := oItems:AddItem("First item. This is a bit ot long text")
oEditor2 := oItems:CellEditor(h,0)
oEditor2:DropDownAlignment := 32/*0x20+*/
oEditor2:EditType := 2/*DropDownType*/
oEditor2:AddItem(1,"First item. This is a bit ot long text")
oEditor2:AddItem(2,"Second item. This is a bit ot long text")
oEditor2:AddItem(3,"Third item. This is a bit ot long text")
oItems:SetProperty("CellValue",h,1,"Second item. This is a bit ot long text")
oEditor3 := oItems:CellEditor(h,1)
oEditor3:DropDownAlignment := 32/*0x20+*/
oEditor3:EditType := 14/*PickEditType*/
oEditor3:AddItem(1,"First item. This is a bit ot long text")
oEditor3:AddItem(2,"Second item. This is a bit ot long text")
oEditor3:AddItem(3,"Third item. This is a bit ot long text")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1595
|
Is there a property for the back color of the dropdown field
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oEditor := oG2antt:Columns():Add("Date"):Editor()
oEditor:EditType := 7/*DateType*/
oEditor:SetProperty("Option",55/*exDropDownBackColor*/,15790320)
oEditor:SetProperty("Option",56/*exDropDownForeColor*/,65793)
oG2antt:Items():AddItem("01/01/2001")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1594
|
Is it possible to change a back color of the field/cell when it takes a focus
PROCEDURE OnEditClose(oG2antt)
LOCAL oItems
oItems := oG2antt:Items()
oItems:ClearCellBackColor(oItems:FocusItem(),oG2antt:FocusColumnIndex())
RETURN
PROCEDURE OnEditOpen(oG2antt)
LOCAL oItems,oItems1
oItems := oG2antt:Items()
oItems:SetProperty("CellBackColor",oItems:FocusItem(),oG2antt:FocusColumnIndex(),AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oItems1 := oG2antt:Items()
oItems1:SetProperty("CellValue",oItems1:FocusItem(),oG2antt:FocusColumnIndex(),oG2antt:Items():CellValue(oG2antt:Items():FocusItem(),oG2antt:FocusColumnIndex()))
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:EditClose := {|| OnEditClose(oG2antt)} /*Occurs when the edit operation ends.*/
oG2antt:EditOpen := {|| OnEditOpen(oG2antt)} /*Occurs when the edit operation starts.*/
oG2antt:FullRowSelect := 0/*exColumnSel*/
oG2antt:Columns():Add("C1"):Editor():EditType := 1/*EditType*/
oG2antt:Columns():Add("C2"):Editor():EditType := 1/*EditType*/
oItems := oG2antt:Items()
oItems:SetProperty("CellValue",oItems:AddItem("v1"),1,"v2")
oItems:SetProperty("CellValue",oItems:AddItem("v3"),1,"v4")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1593
|
How can I display the current date mask, but still allow empty values

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:CauseValidateValue := -1/*exValidateCell*/
oG2antt:FullRowSelect := 0/*exColumnSel*/
oG2antt:DrawGridLines := -2/*exRowLines*/
oEditor := oG2antt:Columns():Add("Date"):Editor()
oEditor:EditType := 7/*DateType*/
oEditor:Mask := "!99/99/9999;1;;empty=1,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
oItems := oG2antt:Items()
oItems:AddItem()
oItems:AddItem("01/01/2001")
oItems:AddItem()
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1592
|
How can I align the days in a DateType editor
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("DropDown")
oItems := oG2antt:Items()
oEditor := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor:EditType := 7/*DateType*/
oEditor:DropDownAlignment := 2/*RightAlignment*/
oEditor1 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor1:EditType := 7/*DateType*/
oEditor1:DropDownAlignment := 1/*CenterAlignment*/
oEditor2 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor2:EditType := 7/*DateType*/
oEditor2:DropDownAlignment := 0/*LeftAlignment*/
oEditor3 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor3:EditType := 7/*DateType*/
oEditor3:DropDownAlignment := 32/*0x20+*/
oEditor4 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor4:EditType := 7/*DateType*/
oEditor4:DropDownAlignment := 33/*0x20+CenterAlignment*/
oEditor5 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor5:EditType := 7/*DateType*/
oEditor5:DropDownAlignment := 34/*0x20+RightAlignment*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1591
|
How can I align the drop down portion rather the inside captions
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor,oEditor1
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("DropDown"):Editor():EditType := 7/*DateType*/
oItems := oG2antt:Items()
oEditor := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor:EditType := 7/*DateType*/
oEditor:DropDownAlignment := 32/*0x20+*/
oEditor1 := oItems:CellEditor(oItems:AddItem("01/01/2001"),0)
oEditor1:EditType := 7/*DateType*/
oEditor1:DropDownAlignment := 16/*exHOutside*/
oItems:AddItem("01/01/2001")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1590
|
Is it possible to show a message that the field is empty

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:DrawGridLines := -2/*exRowLines*/
oG2antt:FullRowSelect := 0/*exColumnSel*/
oColumn := oG2antt:Columns():Add("Float")
oEditor := oColumn:Editor()
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := ";;;float,digits=0,grouping=,invalid=empty,warning=invalid character"
oG2antt:Items():AddItem(192278)
oG2antt:Items():AddItem(1000)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1589
|
How can I mask a date

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6,oEditor7,oEditor8
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:CauseValidateValue := -1/*exValidateCell*/
oG2antt:FullRowSelect := 0/*exColumnSel*/
oG2antt:DrawGridLines := -2/*exRowLines*/
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Mask")
oItems := oG2antt:Items()
h := oItems:AddItem("01/01/2001")
oEditor := oItems:CellEditor(h,0)
oEditor:EditType := 7/*DateType*/
oEditor:Mask := "{1,12}/{1,31}/{1950,2050};1;;select=1,warning=Invalid character!,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,validateas=1"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oEditor1 := oItems:CellEditor(h,0)
oEditor1:EditType := 7/*DateType*/
oEditor1:Mask := "!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oEditor2 := oItems:CellEditor(h,0)
oEditor2:EditType := 7/*DateType*/
oEditor2:Mask := "!99/99/9999;;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oEditor3 := oItems:CellEditor(h,0)
oEditor3:EditType := 7/*DateType*/
oEditor3:Mask := "!99/99/9999;; ;select=4,overtype,empty,warning=Invalid character!,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,validateas=1"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oEditor4 := oItems:CellEditor(h,0)
oEditor4:EditType := 7/*DateType*/
oEditor4:Mask := "![0-9 ][0-9 ]/[0-9 ][0-9 ]/[0-9 ][0-9 ][0-9 ][0-9 ];1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,leading= "
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
oEditor5 := oItems:CellEditor(h,0)
oEditor5:EditType := 7/*DateType*/
oEditor5:Mask := "!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype,leading"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
oEditor6 := oItems:CellEditor(h,0)
oEditor6:EditType := 7/*DateType*/
oEditor6:Mask := "!00/00/0000;1;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype,leading"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
oEditor7 := oItems:CellEditor(h,0)
oEditor7:EditType := 7/*DateType*/
oEditor7:Mask := "!00/00/0000;;0;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=4,overtype"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
h := oItems:AddItem("01/01/2001")
oItems:SetProperty("FormatCell",h,0,"len(value) ? shortdateF(value) : ``")
oEditor8 := oItems:CellEditor(h,0)
oEditor8:EditType := 7/*DateType*/
oEditor8:Mask := "!00/00/0000;;;empty,validateas=1,invalid=Invalid date\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,select=1,overtype"
oItems:SetProperty("CellValue",h,1,oItems:CellEditor(h,0):Mask())
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1588
|
How can I display and edit an integer number to show grouping digits too ( no decimals)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumn := oG2antt:Columns():Add("Float")
oColumn:FormatColumn := "value format `0`"
oEditor := oColumn:Editor()
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := ";;;float,digits=0"
oG2antt:Items():AddItem(192278)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1587
|
How can I display and edit a float number to show grouping digits too
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumn := oG2antt:Columns():Add("Float")
oColumn:FormatColumn := "value format ``"
oEditor := oColumn:Editor()
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := ";;;float"
oG2antt:Items():AddItem(192278)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1586
|
How can I mask a phone number

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor,oEditor1,oEditor2,oEditor3
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:CauseValidateValue := -1/*exValidateCell*/
oG2antt:DrawGridLines := -2/*exRowLines*/
oG2antt:FullRowSelect := 0/*exColumnSel*/
oG2antt:Columns():Add("Phone"):Editor():EditType := 8/*MaskType*/
oItems := oG2antt:Items()
h := oItems:AddItem()
oEditor := oItems:CellEditor(h,0)
oEditor:EditType := 8/*MaskType*/
oEditor:Mask := "!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid characer,invalid=The value you entered isn't appropriate for the input mask <b>'<%mask%>'</b> specified for this field."
h := oItems:AddItem("0123")
oEditor1 := oItems:CellEditor(h,0)
oEditor1:EditType := 8/*MaskType*/
oEditor1:Mask := "!(999) 000 0000;2;;select=4"
h := oItems:AddItem("0123")
oEditor2 := oItems:CellEditor(h,0)
oEditor2:EditType := 8/*MaskType*/
oEditor2:Mask := "`Phone: `!(999) 000-0000"
h := oItems:AddItem("(074) 876-1222")
oEditor3 := oItems:CellEditor(h,0)
oEditor3:EditType := 8/*MaskType*/
oEditor3:Mask := "!(999) 000-0000;0"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1585
|
Is it possible to display the ColorType fields using RGB format
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor,oEditor1,oEditor2,oEditor3,oEditor4,oEditor5,oEditor6
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Color"):Editor():EditType := 9/*ColorType*/
oItems := oG2antt:Items()
oItems:AddItem(255)
h := oItems:AddItem(255)
oEditor := oItems:CellEditor(h,0)
oEditor:EditType := 9/*ColorType*/
oEditor:Mask := "`RGB(`{0,255}\,{0,255}\,{0,255}`)`;;0"
h := oItems:AddItem(255)
oEditor1 := oItems:CellEditor(h,0)
oEditor1:EditType := 9/*ColorType*/
oEditor1:Mask := "`&H`XXXXXXXX`&`;;0;overtype,insertype,warning=Wrong!"
h := oItems:AddItem(255)
oEditor2 := oItems:CellEditor(h,0)
oEditor2:EditType := 9/*ColorType*/
oEditor2:Mask := "`0x`XX `0x`XX `0x`XX;;0;overtype,insertype,warning=Wrong!"
h := oItems:AddItem(255)
oEditor3 := oItems:CellEditor(h,0)
oEditor3:EditType := 9/*ColorType*/
oEditor3:Mask := "R{0,255} G{0,255} B{0,255};;0;overtype,insertype,warning=Wrong!"
h := oItems:AddItem(255)
oEditor4 := oItems:CellEditor(h,0)
oEditor4:EditType := 9/*ColorType*/
oEditor4:Mask := "`(hexa) RGB 0x`XXXXXX;;0;overtype,insertype,warning=Wrong!"
h := oItems:AddItem(255)
oEditor5 := oItems:CellEditor(h,0)
oEditor5:EditType := 9/*ColorType*/
oEditor5:Mask := "`(decimal) Red: `{0,255}` Green: `{0,255}` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"
h := oItems:AddItem(255)
oEditor6 := oItems:CellEditor(h,0)
oEditor6:EditType := 9/*ColorType*/
oEditor6:Mask := "`(combine) Red: `{0,255}` Green: 0x`XX` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1584
|
How can I specify a different color for bars that cross over the non-working part of the chart

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBars
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Task")
oBars := oG2antt:Chart():Bars()
oBars:CallMethod("Copy","Task","STask"):SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBars:Add("Task:STask"):Shortcut := "TS"
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,96)
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("NonworkingDaysColor",oChart:Bars:Item("STask"):Color())
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Task 1"),"TS","01/02/2001","01/16/2001")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1583
|
How can I merge two columns

PROCEDURE OnAddItem(oG2antt,Item)
oG2antt:Items():SetProperty("CellMerge",Item,0,1)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:AddItem := {|Item| OnAddItem(oG2antt,Item)} /*Occurs after a new Item has been inserted to Items collection.*/
oG2antt:MarkSearchColumn := .F.
oG2antt:TreeColumnIndex := -1
oG2antt:DrawGridLines := -1/*exAllLines*/
oG2antt:Columns():Add("C1"):SetProperty("Def",16/*exCellSingleLine*/,.F.)
oG2antt:Columns():Add("C2")
oG2antt:Columns():Add("C3")
oItems := oG2antt:Items()
oItems:AddItem("This is bit of text that's shown on multiple lines. This is bit of text that's shown on multiple lines.")
oItems:AddItem("This is bit of text that's shown on multiple lines. This is bit of text that's shown on multiple lines.")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1582
|
How can I expand an item once the user clicks the column's checkbox

PROCEDURE OnCellStateChanged(oG2antt,Item,ColIndex)
LOCAL oItems
oItems := oG2antt:Items()
oItems:SetProperty("ExpandItem",Item,.F.)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:CellStateChanged := {|Item,ColIndex| OnCellStateChanged(oG2antt,Item,ColIndex)} /*Fired after cell's state has been changed.*/
oG2antt:BeginUpdate()
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:AllowSizing := .F.
oColumn:Width := 18
oColumn:PartialCheck := .T.
oColumns:Add("Tasks")
oG2antt:ShowFocusRect := .F.
oG2antt:HasButtons := 0/*exNoButtons*/
oG2antt:TreeColumnIndex := 1
oG2antt:Indent := 14
oG2antt:ExpandOnDblClick := .F.
oG2antt:LinesAtRoot := 0/*exNoLinesAtRoot*/
oItems := oG2antt:Items()
h := oItems:AddItem("")
oItems:SetProperty("CellState",h,0,1)
oItems:SetProperty("CellValue",h,1,"Project")
hChild := oItems:InsertItem(h,,"")
oItems:SetProperty("CellValue",hChild,1,"Task 1")
hChild := oItems:InsertItem(h,,"")
oItems:SetProperty("CellValue",hChild,1,"Task 2")
oItems:SetProperty("ExpandItem",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1581
|
How can I define a column with check-box
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
LOCAL h,hChild
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:AllowSizing := .F.
oColumn:Width := 18
oColumn:PartialCheck := .T.
oColumns:Add("Tasks")
oG2antt:ShowFocusRect := .F.
oG2antt:HasButtons := 0/*exNoButtons*/
oG2antt:TreeColumnIndex := 1
oG2antt:Indent := 14
oG2antt:ExpandOnDblClick := .F.
oG2antt:LinesAtRoot := 0/*exNoLinesAtRoot*/
oItems := oG2antt:Items()
h := oItems:AddItem("")
oItems:SetProperty("CellState",h,0,1)
oItems:SetProperty("CellValue",h,1,"Project")
hChild := oItems:InsertItem(h,,"")
oItems:SetProperty("CellValue",hChild,1,"Task 1")
hChild := oItems:InsertItem(h,,"")
oItems:SetProperty("CellValue",hChild,1,"Task 2")
oItems:SetProperty("ExpandItem",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1580
|
We need to know how it's possibile to have the bars on the same line and not in a different line

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:DrawGridLines := -1/*exAllLines*/
oChart := oG2antt:Chart()
oChart:DrawGridLines := -1/*exAllLines*/
oChart:FirstVisibleDate := "01/01/2002"
oChart:Bars:Item("Task"):OverlaidType := 515/*exOverlaidBarsStackAutoArrange+exOverlaidBarsStack*/
oChart:SetProperty("PaneWidth",.F.,128)
oG2antt:Columns():Add("Task")
oItems := oG2antt:Items()
h := oItems:AddItem("Tasks")
oItems:AddBar(h,"Task","01/02/2002","01/07/2002","A")
oItems:AddBar(h,"Task","01/03/2002","01/08/2002","B")
oItems:AddBar(h,"Task","01/04/2002","01/09/2002","C")
oItems:SetProperty("ItemBar",h,"A",33/*exBarColor*/,255)
oItems:AddLink("AB",h,"A",h,"B")
oItems:AddLink("BC",h,"B",h,"C")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1579
|
The Change event gets me the today date. How can I find what user typed
PROCEDURE OnChange(oG2antt,Item,ColIndex,NewValue)
DevOut( "NewValue:" )
DevOut( Transform(NewValue,"") )
DevOut( "EditingValue:" )
DevOut( oG2antt:EditingText() )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Change := {|Item,ColIndex,NewValue| OnChange(oG2antt,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/
oG2antt:BeginUpdate()
oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
oG2antt:Columns():Add("Edit"):Editor():EditType := 7/*DateType*/
oG2antt:Items():AddItem("01/01/2001")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1578
|
How can I add a footer row
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ShowLockedItems := .T.
oG2antt:DrawGridLines := 2/*exVLines*/
oG2antt:Columns():Add("C1")
oG2antt:Columns():Add("C2")
oItems := oG2antt:Items()
oItems:SetProperty("LockedItemCount",2/*exBottom*/,1)
h := oItems:LockedItem(2/*exBottom*/,0)
oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oItems:SetProperty("ItemForeColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oItems:SetProperty("CellValue",h,0,"footer c1")
oItems:SetProperty("CellValue",h,1,"footer c2")
oItems:SetProperty("CellValue",oItems:AddItem("cell"),1,"cell")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1577
|
How can I add a header row
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ShowLockedItems := .T.
oG2antt:DrawGridLines := 2/*exVLines*/
oG2antt:Columns():Add("C1")
oG2antt:Columns():Add("C2")
oItems := oG2antt:Items()
oItems:SetProperty("LockedItemCount",0/*exTop*/,1)
h := oItems:LockedItem(0/*exTop*/,0)
oItems:SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oItems:SetProperty("ItemForeColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oItems:SetProperty("CellValue",h,0,"footer c1")
oItems:SetProperty("CellValue",h,1,"footer c2")
oItems:SetProperty("CellValue",oItems:AddItem("cell"),1,"cell")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1576
|
How can I fix a column, while other sizable and fill the control's client
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .T.
oG2antt:Columns():Add("Sizable")
oColumn := oG2antt:Columns():Add("F")
oColumn:AllowSizing := .F.
oColumn:Width := 16
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1575
|
How can I programmatically add more columns to the sort bar and other to be sorted, but not included in the sort bar

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:SortBarVisible := .T.
oColumns := oG2antt:Columns()
oColumns:Add(Transform(0,""))
oColumns:Add(Transform(1,""))
oColumns:Add(Transform(2,""))
oColumns:Add(Transform(3,""))
oColumns:Add(Transform(4,""))
oG2antt:Layout := "multiplesort=" + CHR(34) + "C3:1 C4:2" + CHR(34) + ";singlesort=" + CHR(34) + "C2:1" + CHR(34) + ""
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1574
|
I'm using different bar types, in order to use different colours. The problem I'm having is that when two bars of different types overlap, and should in the histogram show as overallocated, they instead overlap here too, and show as single unit. Is there a way I can correctly show this as an overallocation

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:HistogramVisible := .T.
oChart:HistogramHeight := 32
oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/
oChart:SetProperty("PaneWidth",.F.,128)
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
h := oItems:AddItem("Item 2")
oItems:AddBar(h,"Task","01/03/2001","01/07/2001")
oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,255)
oItems:AddBar(oItems:AddItem("Item 3"),"Task","01/06/2001","01/09/2001")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1573
|
Is it possible to assign a different EBN to a specified bar

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(1,"c:\exontrol\images\normal.ebn")
oAppearance:Add(2,"c:\exontrol\images\pushed.ebn")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,128)
oG2antt:Columns():Add("Tasks")
oItems := oG2antt:Items()
h := oItems:AddItem("Task 1")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
h := oItems:AddItem("Task 2")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,255)
h := oItems:AddItem("Task 3")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,16777216)
h := oItems:AddItem("Task 4")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,16777471)
h := oItems:AddItem("Task 5")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",33/*exBarColor*/,33619967)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1572
|
How can I provide a mask for a date column
PROCEDURE OnChange(oG2antt,Item,ColIndex,NewValue)
DevOut( "Prev Value " )
DevOut( Transform(oG2antt:Items:CellValue(Item,ColIndex),"") )
DevOut( "Check and Update the NewValue" )
DevOut( Transform(NewValue,"") )
NewValue := "01/01/2001"
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Change := {|Item,ColIndex,NewValue| OnChange(oG2antt,Item,ColIndex,NewValue)} /*Occurs when the user changes the cell's content.*/
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oColumn := oG2antt:Columns():Add("Date")
oColumn:FormatColumn := "day(value) + `/` + month(value) + `/` + year(value)"
oEditor := oColumn:Editor()
oEditor:EditType := 7/*DateType*/
oEditor:Mask := "{1,12}\/{1,31}\/{1,2099}"
oG2antt:Items():AddItem("01/01/2001")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1571
|
I am trying to introduce a custom tool tip to those particular cells. I have it working and I know I can style the font etc. however, what I would like to do is style the tooltip container itself like add some padding or add a border color. Is this possible
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ToolTipDelay := 1
oG2antt:ToolTipWidth := 364
oG2antt:VisualAppearance():Add(1,"C:\Program Files\Exontrol\ExG2antt\Sample\EBN\frame.ebn")
oG2antt:SetProperty("Background",64/*exToolTipAppearance*/,0x1000000)
oG2antt:Columns():Add("tootip"):ToolTip := "this is a tooltip assigned to a column"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1570
|
Is it possible to edit a float number without using of e/E/d/D (exponent) and +/- (signs) characters
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oEditor := oG2antt:Columns():Add("Edit"):Editor()
oEditor:EditType := 1/*EditType*/
oEditor:Numeric := 770/*exDisableSigns+exFloatInteger*/
oG2antt:Items():AddItem(1.22)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1569
|
How can I edit a float number with no using of e/E/d/D and + character
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oEditor := oG2antt:Columns():Add("Edit"):Editor()
oEditor:EditType := 1/*EditType*/
oEditor:Numeric := 258/*exDisablePlus+exFloatInteger*/
oG2antt:Items():AddItem(1.22)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1568
|
Is it possible to edit a float number with no using of e/E/d/D (exponent) characters
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oEditor := oG2antt:Columns():Add("Edit"):Editor()
oEditor:EditType := 1/*EditType*/
oEditor:Numeric := 2/*exFloatInteger*/
oG2antt:Items():AddItem(1.22)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1567
|
How can I edit an integer with no using of +/- signs
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oEditor
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oEditor := oG2antt:Columns():Add("Edit"):Editor()
oEditor:EditType := 1/*EditType*/
oEditor:Numeric := 1023/*0xfc+exDisableSigns+exFloatInteger+exFloat*/
oG2antt:Items():AddItem(1)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1566
|
When I'm trying to show string with "line break" character (vbCrLF) in a textbox, it shows 2 squares. Is there any way to hide these squares

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumns := oG2antt:Columns()
oColumns:Add("Value")
oColumn := oColumns:Add("CellSingleLine = False")
oColumn:ComputedField := "%0"
oColumn:SetProperty("Def",16/*exCellSingleLine*/,.F.)
oColumn1 := oColumns:Add("FormatColumn/replace CRLF")
oColumn1:ComputedField := "%0"
oColumn1:FormatColumn := "value replace `\r\n` with ``"
oColumn2 := oColumns:Add("FormatColumn/replace TAB,CRLF")
oColumn2:ComputedField := "%0"
oColumn2:FormatColumn := "(value replace `\t` with ``) replace `\r\n` with ``"
oItems := oG2antt:Items()
oItems:AddItem("a\ta\r\nb\tb")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1565
|
I am using the Chart.ShowLinksColor property, the question is it is possible to prevent changing the bar's color

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:DefaultItemHeight := 24
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,48)
oChart:NonworkingDays := 0
oChart:LinksStyle := 0/*exLinkSolid*/
oChart:SetProperty("ShowLinksColor",17/*exUpdateColorLinksOnly+exShowLinksStartFrom*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oChart:SetProperty("ShowLinksColor",18/*exUpdateColorLinksOnly+exShowLinksEndTo*/,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","01/02/2001","01/04/2001","")
oItems:SetProperty("ItemBar",h2,"",257/*exBarSelected*/,.T.)
oItems:AddLink("L1",h1,"",h2,"")
h3 := oItems:AddItem("Task 3")
oItems:AddBar(h3,"Task","01/02/2001","01/04/2001","")
oItems:AddLink("L2",h2,"",h3,"")
oItems:SchedulePDM(0,"")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1564
|
Apparently, the links are shown on the back. Is there any option to bring them in front

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h1,h2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/19/2006"
oChart:SetProperty("PaneWidth",.F.,64)
oChart:NonworkingDaysPattern := 1/*exPatternSolid*/
oChart:ShowLinks := 17/*exShowLinksFront+exShowExtendedLinks*/
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","09/20/2006","09/22/2006")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","09/26/2006","09/28/2006")
oItems:SetProperty("ItemBar",h2,"",257/*exBarSelected*/,.T.)
oItems:AddLink("L1",h1,"",h2,"")
oItems:SetProperty("Link","L1",12/*exLinkText*/,"L1")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1563
|
How can I enable the extended links feature

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:DefaultItemHeight := 24
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,48)
oChart:NonworkingDays := 0
oChart:LinksStyle := 0/*exLinkSolid*/
oChart:ShowLinks := 1/*exShowExtendedLinks*/
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","01/02/2001","01/04/2001","")
oItems:AddLink("L1",h1,"",h2,"")
h3 := oItems:AddItem("Task 3")
oItems:AddBar(h3,"Task","01/02/2001","01/04/2001","")
oItems:AddLink("L2",h3,"",h2,"")
oItems:SchedulePDM(0,"")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1562
|
How do I count all bars in the chart
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Task")
oItems:AddBar(hSummary,"Task","01/02/2001","01/05/2001","K1")
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K1")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.1"),"Task","01/03/2001","01/05/2001","K11")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.2"),"Task","01/03/2001","01/05/2001","K12")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K2")
hTask := oItems:InsertItem(hTask,,"Task B.1")
oItems:AddBar(hTask,"Task","01/05/2001","01/09/2001","K21")
oItems:SetProperty("ExpandItem",0,.T.)
DevOut( "Count: " )
DevOut( Transform(oItems:ItemBar(0,"<*>",256/*exBarsCount*/),"") )
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1561
|
Is there any property to count the all child bars of a specified item ( all descendents )
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oChart:Bars():CallMethod("Copy","Task","CountTask"):SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Project")
oItems:SetProperty("ItemBold",hSummary,.T.)
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"CountTask","01/02/2001","01/05/2001","K1")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.1"),"CountTask","01/03/2001","01/05/2001","K11")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.2"),"CountTask","01/03/2001","01/05/2001","K12")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"CountTask","01/02/2001","01/05/2001","K2")
hTask := oItems:InsertItem(hTask,,"Task B.1")
oItems:AddBar(hTask,"CountTask","01/05/2001","01/09/2001","K21")
oItems:SetProperty("ExpandItem",0,.T.)
oItems:DefaultItem := oItems:ItemByIndex(0)
DevOut( "Count: " )
DevOut( Transform(oItems:ItemBar(-3,"<*>",256/*exBarsCount*/),"") )
oItems:DefaultItem := 0
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1560
|
Is there any property to count the child bars of a specified item ( leaf descendents )
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oChart:Bars():CallMethod("Copy","Task","CountTask"):SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Project")
oItems:SetProperty("ItemBold",hSummary,.T.)
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K1")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.1"),"CountTask","01/03/2001","01/05/2001","K11")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.2"),"CountTask","01/03/2001","01/05/2001","K12")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K2")
hTask := oItems:InsertItem(hTask,,"Task B.1")
oItems:AddBar(hTask,"CountTask","01/05/2001","01/09/2001","K21")
oItems:SetProperty("ExpandItem",0,.T.)
oItems:DefaultItem := oItems:ItemByIndex(0)
DevOut( "Count: " )
DevOut( Transform(oItems:ItemBar(-2,"<*>",256/*exBarsCount*/),"") )
oItems:DefaultItem := 0
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1559
|
Is there any property to count the child bars of a specified item ( direct descendents )
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oChart:Bars():CallMethod("Copy","Task","CountTask"):SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Project")
oItems:SetProperty("ItemBold",hSummary,.T.)
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"CountTask","01/02/2001","01/05/2001","K1")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.1"),"Task","01/03/2001","01/05/2001","K11")
oItems:AddBar(oItems:InsertItem(hTask,,"Task A.2"),"Task","01/03/2001","01/05/2001","K12")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"CountTask","01/02/2001","01/05/2001","K2")
hTask := oItems:InsertItem(hTask,,"Task B.1")
oItems:AddBar(hTask,"Task","01/05/2001","01/09/2001","K21")
oItems:SetProperty("ExpandItem",0,.T.)
oItems:DefaultItem := oItems:ItemByIndex(0)
DevOut( "Count: " )
DevOut( Transform(oItems:ItemBar(-1,"<*>",256/*exBarsCount*/),"") )
oItems:DefaultItem := 0
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1558
|
How can I define all child items to belong to a summary bar (DefineSummaryBars-3)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Summary")
oItems:AddBar(hSummary,"Summary","01/02/2001","01/02/2001","")
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K1")
hTask := oItems:InsertItem(hTask,,"Task A.1")
oItems:AddBar(hTask,"Task","01/03/2001","01/05/2001","K11")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K2")
hTask := oItems:InsertItem(hTask,,"Task B.1")
oItems:AddBar(hTask,"Task","01/05/2001","01/09/2001","K21")
oItems:DefineSummaryBars(hSummary,"",-3,"<K*>")
oItems:SetProperty("ExpandItem",0,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1557
|
Can I define automatically the leaf descendents of the summary bar (DefineSummaryBars-2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Summary")
oItems:AddBar(hSummary,"Summary","01/02/2001","01/02/2001","")
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"1Task","01/02/2001","01/05/2001","K1")
hTask := oItems:InsertItem(hTask,,"Task A.1")
oItems:AddBar(hTask,"Task","01/03/2001","01/05/2001","K11")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"1Task","01/02/2001","01/05/2001","K2")
hTask := oItems:InsertItem(hTask,,"Task B.1")
oItems:AddBar(hTask,"Task","01/05/2001","01/09/2001","K21")
oItems:DefineSummaryBars(hSummary,"",-2,"<K*>")
oItems:SetProperty("ExpandItem",0,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1556
|
How can I assign the childs bars to a summary bar (DefineSummaryBars-1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Summary")
oItems:AddBar(hSummary,"Summary","01/02/2001","01/02/2001","")
hTask := oItems:InsertItem(hSummary,,"Task A")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001","K1")
hTask := oItems:InsertItem(hSummary,,"Task B")
oItems:AddBar(hTask,"Task","01/04/2001","01/08/2001","K2")
oItems:SetProperty("ExpandItem",hSummary,.T.)
oItems:DefineSummaryBars(hSummary,"",-1,"<*>")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1555
|
Is it possible to define a summary bar to include all bars in the chart (DefineSummaryBars-0)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Summary")
oItems:AddBar(hSummary,"Summary","01/02/2001","01/02/2001","summary")
oItems:AddBar(oItems:AddItem("Task A"),"Task","01/02/2001","01/05/2001","K1")
oItems:AddBar(oItems:AddItem("Task B"),"Task","01/06/2001","01/09/2001","K2")
oItems:AddBar(oItems:AddItem("Task C"),"Task","01/11/2001","01/14/2001","K3")
oItems:DefineSummaryBars(hSummary,"summary",0,"<K*>")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1554
|
Is there any way to "unselect" radio group
PROCEDURE OnDblClick(oG2antt,Shift,X,Y)
LOCAL oItems
LOCAL h
oItems := oG2antt:Items()
h := oItems:CellChecked(1234)
oItems:SetProperty("CellHasCheckBox",0,h,.T.)
oItems:SetProperty("CellState",0,h,0)
oItems:SetProperty("CellHasCheckBox",0,h,.F.)
RETURN
PROCEDURE OnSelectionChanged(oG2antt)
LOCAL oItems
oItems := oG2antt:Items()
oItems:SetProperty("CellState",oItems:FocusItem(),0,1)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:DblClick := {|Shift,X,Y| OnDblClick(oG2antt,Shift,X,Y)} /*Occurs when the user dblclk the left mouse button over an object.*/
oG2antt:SelectionChanged := {|| OnSelectionChanged(oG2antt)} /*Fired after a new item has been selected.*/
oG2antt:MarkSearchColumn := .F.
oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,128 } ) , .F. ))
oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oG2antt:Columns():Add("Default")
oItems := oG2antt:Items()
h := oItems:AddItem("Radio 1")
oItems:SetProperty("CellHasRadioButton",h,0,.T.)
oItems:SetProperty("CellRadioGroup",h,0,1234)
h := oItems:AddItem("Radio 2")
oItems:SetProperty("CellHasRadioButton",h,0,.T.)
oItems:SetProperty("CellRadioGroup",h,0,1234)
oItems:SetProperty("CellState",h,0,1)
h := oItems:AddItem("Radio 3")
oItems:SetProperty("CellHasRadioButton",h,0,.T.)
oItems:SetProperty("CellRadioGroup",h,0,1234)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1553
|
The Column.Alignment property does not seem to work for cells with images in them. What can be done
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oG2antt:TreeColumnIndex := -1
oG2antt:DrawGridLines := -1/*exAllLines*/
oG2antt:HeaderHeight := 24
oG2antt:DefaultItemHeight := 24
oColumn := oG2antt:Columns():Add("Image")
oColumn:AllowSizing := .F.
oColumn:Width := 32
oColumn:HTMLCaption := "<img>1</img>"
oColumn:HeaderAlignment := 1/*CenterAlignment*/
oColumn:Alignment := 1/*CenterAlignment*/
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oG2antt:Columns():Add("Rest")
oItems := oG2antt:Items()
oItems:AddItem("<img>1</img>")
oItems:AddItem("<img>2</img>")
oItems:AddItem("<img>3</img>")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1552
|
Is there any way to determine in a bar would overlay another bar or to not allow this and get some error indication

PROCEDURE OnBarResize(oG2antt,Item,Key)
oG2antt:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar,oBar1
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BarResize := {|Item,Key| OnBarResize(oG2antt,Item,Key)} /*Occurs when a bar is moved or resized.*/
oG2antt:BeginUpdate()
oG2antt:DefaultItemHeight := 22
oG2antt:Columns():Add("InterectBars")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,48)
oChart:FirstVisibleDate := "01/01/2001"
oBar := oChart:Bars:Item("Task")
oBar:OverlaidType := 2/*exOverlaidBarsIntersect*/
oBar:SetProperty("Overlaid",2/*exOverlaidBarsIntersect*/,"ERROR")
oBar1 := oChart:Bars():Add("ERROR")
oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBar1:Pattern := 1/*exPatternSolid*/
oBar1:Height := 7
oItems := oG2antt:Items()
h := oItems:AddItem("")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A","A")
oItems:AddBar(h,"Task","01/03/2001","01/05/2001","B","B")
oItems:SetProperty("CellValue",h,0,oItems:IntersectBars(h,"A",h,"B"))
h := oItems:AddItem("")
oItems:AddBar(h,"Task","01/06/2001","01/09/2001","A","A")
oItems:AddBar(h,"Task","01/10/2001","01/13/2001","B","B")
oItems:SetProperty("CellValue",h,0,oItems:IntersectBars(h,"A",h,"B"))
h := oItems:AddItem("")
oItems:AddBar(h,"Task","01/06/2001","01/09/2001","B","B")
oItems:AddBar(h,"Task","01/10/2001","01/13/2001","A","A")
oItems:SetProperty("CellValue",h,0,oItems:IntersectBars(h,"A",h,"B"))
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1551
|
Is it possible to change the font size of the header compared to that of the control. I would like to make the font of the headers smaller
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:HeaderHeight := 32
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("ID")
oColumn:HTMLCaption := "<font ;16>ID"
oColumn:Width := 32
oColumn:AllowSizing := .F.
oColumns:Add("Task"):HTMLCaption := "<font ;16>Task"
oG2antt:FocusColumnIndex := 1
oG2antt:ShowFocusRect := .F.
oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
oItems := oG2antt:Items()
oItems:SetProperty("CellValue",oItems:AddItem(1),1,"Task A")
oItems:SetProperty("CellValue",oItems:AddItem(2),1,"Task B")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1550
|
How can I create items and bars at runtime
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("ID")
oColumn:FormatColumn := "1 index ''"
oColumn:Width := 32
oColumn:AllowSizing := .F.
oColumns:Add("Task"):Editor():EditType := 1/*EditType*/
oG2antt:FocusColumnIndex := 1
oG2antt:ShowFocusRect := .F.
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oChart:AllowCreateBar := 1/*exCreateBarAuto*/
oG2antt:Template := "Chart.Bars(" + CHR(34) + "Task" + CHR(34) + "){Def(3) = " + CHR(34) + "<%=%C1%>" + CHR(34) + ";Def(4)=18}"
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1549
|
How can I a group summary bar with a task bar, so when the summary bar changes the task bar will move accordingly

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL hSummary,hTask
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
hSummary := oItems:AddItem("Summary")
oItems:AddBar(hSummary,"Summary","01/02/2001","01/02/2001")
hTask := oItems:AddItem("Task A")
oItems:AddBar(hTask,"Task","01/02/2001","01/05/2001")
oItems:DefineSummaryBars(hSummary,"",hTask,"")
hTask := oItems:AddItem("Task B")
oItems:AddBar(hTask,"Task","01/04/2001","01/08/2001")
oItems:DefineSummaryBars(hSummary,"",hTask,"")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1548
|
How can I show the bars using a solid color, with no pattern inside

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:DefaultItemHeight := 24
oG2antt:DrawGridLines := -1/*exAllLines*/
oChart := oG2antt:Chart()
oChart:DrawGridLines := -1/*exAllLines*/
oChart:NonworkingDays := 0
oChart:SetProperty("PaneWidth",.F.,128)
oChart:FirstVisibleDate := "01/01/2001"
oChart:Bars:Item("Task"):Pattern := 1/*exPatternSolid*/
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
h := oItems:AddItem("Solid A")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A")
oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B")
oItems:SetProperty("ItemBar",h,"B",33/*exBarColor*/,255)
oItems:AddBar(h,"Task","01/08/2001","01/10/2001","C")
oItems:SetProperty("ItemBar",h,"C",33/*exBarColor*/,65280)
h := oItems:AddItem("Solid B")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001","A")
oItems:SetProperty("ItemBar",h,"A",7/*exBarBackColor*/,255)
oItems:AddBar(h,"Task","01/05/2001","01/07/2001","B")
oItems:SetProperty("ItemBar",h,"B",33/*exBarColor*/,255)
oItems:SetProperty("ItemBar",h,"B",7/*exBarBackColor*/,65280)
oItems:AddBar(h,"Task","01/08/2001","01/10/2001","C")
oItems:SetProperty("ItemBar",h,"C",33/*exBarColor*/,16711680)
oItems:SetProperty("ItemBar",h,"C",7/*exBarBackColor*/,16711935)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1547
|
Basically what I am trying to do is replicate MS Project look & feel. Is that possible

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAEGg4BNUMQAAYAQGKIYBkAKBQAGaAoDDMOQ4QwAAxDCKsEwsACEIrjKCRShyCYZRhGcTALD8EhhECTZKkAYQEiKLoaRzAcwyDAcQRFCKUJxhEYZai+NobSBQMZqBQgASIUCLZ5ACSYEigAovTULCKwJiWNZDUTRcTxCKQahLLivIhGUYKfgmY5lT5VUT1HS9IShJSmKTlORLOi+M4zUJLc4SVblGz7FyfYDBKygLqqFigLAxdDYTRNfzjHiTKbtGA7MADA4DVTAeC2bC+EYVTytY4sHQrIACZ5iWREMhXTi0E4rTa6dTxaS6KzKGqsZbsNAbHLdHTfVy1Mx1XaobqDJZdaTpdjaTDeJSjVjKdx4TZqSizjSGJOgcU4RhcIQDDURhIESXwEGgbQJBQQjeggQBiC4NJAluGJrAUB5Lmmc56n4Pp/i+NQjmqdQ5k2J5+AGAAgCgFgEgAHxQAGfoBmAOA2AaAxghgLgOgMIJ4AoER8mE" +;
"WBSBoNohHKAgZgSYgIHYH4ImCB5OAqBghjiEgcgmIQoioD4IiKGJGCsUgUHiVirmOBQVAEgI=")
oAppearance:Add(39,"CP:1 -1 -1 0 0")
oAppearance:Add(40,"gBFLBCJwBAEHhEJAEGg4BEcMQAAYAQGKIYBkAKBQAGaAoDDMOQ4QwAAxDCKsEwsACEIrjKCRShyCYZRhGcTAFD8EhhECTZKkAZwEiKLoaRzAcwyDAcQRFCKUJxlKa5PjaLwAAbJMZKAqDDgBIijIqnKA5JoyKIkTzCIJxXScByDGqNaQoehYXhEMg1CTXVgRCKoYTDBKybLqGT6VoCP5vWJaURWHZFTTJOyNagmSJ6XACbQMW7gNYQGBEEigNIxToOU4jFDGIB2VAQRK5BDQbQSFCpIRCCRQYhcQJ6YIAD76HomS5NU7UNKhHSdMy3J6ra5sOqbBqWa5LWjbNq3DadSzvPKub5vexwHwWawSUDkOR5Li+M43S4JPS5bZdDxPiWVJrnWOw9F6XxTiGWpsHcO5+C6Xx7kOZpwHoOxeF8T4fkeYJgnEdZwOwQRBnSex9H6f4vk+c5xn4fZQhQBCAg==")
oAppearance:Add(41,"gBFLBCJwBAEHhEJAEGg4BQICg6AADACAxRDAMkOQAGaAoDDUMQyQwAAxDSK8EwsACEIrjKCRShyCYZRhGcTALBMIwKGABIRGUZJGDkOYgDCBEhTHDUOwHGyQYDkCQoRiYMAwTBQMaTXDdCQ1ECkJomObqAgkMZCTbKMySAA0NgPD6sKSjOIRSDUJZcV5EoAKfiqZIRSJSMZVLLVNSVJipAAlOTZPo6JJuTLOE4WVRcSydH6oAApeg6KoYAFzQAEDCbYgOTKBYLUOCwTZmDwTK6BcTtXDbejeYYcZ7DNj2NYtJ4TRCBcpzLLIXrCKg0TBPQ4YNC2DT5VDWIq1aDdQo7MpxWjlGI5Ri2c51UDSYi0G4tDyLSYWXDfFSQTrHDQXhAAghCUAxJgyaB1DkGRyDCKBhAiGwLg0DYhCKDI8CcVwIAwRotBeAYCCmBZ0nsfR+n+L5PlYE53BwTpzn4AIAiAGAOAMfZfmeVBwDuD54C4DYDCCaA6AgQJfHGPJtD+" +;
"YRoGIF4GGGrAAH2RpjjCf4IGIOIKCSCQhmeXBtDqT54i4LYLCKaI6CkfRGlOKgtg2IxYl4OoMkwIYwmkP5jmkAg/hAZAYnAaw6A+eQeEmEgkikKg8BqDkYFCFIlBkThTg8BoThif4WGWORqFyFwjkGIJlD+ZgphIY4ZGYWYEmSGQmjGIhthvMpwGcOJPnmTh1h0JxploPAZg4I5+HyH4nlmfh/g8BhTgSf4hGgegagiIlShCYA/miahCg+JBpUIYw3k+ehehmJgpioaoWDeKYagAY4oioSZFn2BQfFGCJdD+aoqjKK4rGqWJwGENwPnqTo1i1gtiBgDYzn6PIviuWp+j+DwFnMaJ/jEbB7BqSIyCOQR4lkP5smsQpPjQbQbDSWI0C0cR6lmNpqGMCgJDCBZTFyf44G4O4KmSOWTnCVg/m6K4ymuOxu4OWw1E+e5OnWPQvGvYgWg0Q5+nyP4vlvE+OBMTJ/kEcB8BsCJCDATArA6QhxAgeIgkScRMFcFp" +;
"FlCFAEICA")
oAppearance:Add(42,"gBFLBCJwBAEHhEJAEGg4BY8MQAAYAQGKIYBkAKBQAGaAoDDMOQ4QwAAwjQLMEwsACEIrjKCRShyCYZRhGcTALD8EhhECTZKkAYgEiKLoaRzAcwyDAcQRFCKUJxhEY5ai+NobRCAUiwHQUBr/I4AKLfeJ5dACKYNShRMrSABMNgZBKpJAqKiqJoiFoRDINIi2BYUIhqGCxYRseyZegmEYWVTREr3HKsVTtAanjZSJakXxnGaQJ7jKaLXo6II8YTIWBABaIAQiBahQArOiKchaTZ5YheFRYVBOG4bK6BcguW4qGxSXpuRxZOo2YAFVzNNC3YzkCIcegnIp9ZxeFK5Tg1Z4XKTaNwqPBcYpHPqdVhCOgYZwUb5XMjWNatLYIboziiUhzCAeJeG6ZAAAiBIUA0JgziGVJkGUGJIBgUYSBEN5VBoGxCEUHItjSFAxBcRhim4dIqFGTB+BUfxfneegAgCYAoBQFR+lQeASAEBRIGESAogMYJ4DoEIEmCaAqAo" +;
"JoGGCbgYgaIYYG4HoHGICByCKAoKmGZBOgkYh4hoKIKmKKI2CmC5giMBINBgY0AjODRjgiXg6g2I8glUKAHEifhBhAJApBYRIRmQOQmAoOgLBIEhMhOJJZD4UoUGUSRCFaAoOHKPIAhYZY5GoXIXmWaYGF2GJlgKMB9DmZhpiIZ4aGaSYuG6GomigWgGDmCohmYdIdicWZeHqHRnCgHgIh8aAIBoCA/lAECAg")
oG2antt:Appearance := 671088640/*0x28000000+*/
oG2antt:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oG2antt:SetProperty("BackColorLevelHeader",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oG2antt:SetProperty("BackColorHeader",0x27000000)
oG2antt:SetProperty("SelBackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. ))
oG2antt:SetProperty("SelForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oChart := oG2antt:Chart()
oChart:SetProperty("BackColorLevelHeader",0x27000000)
oChart:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. ))
oChart:Bars:Item("Task"):SetProperty("Color",0x2a000000)
oG2antt:SetProperty("FilterBarBackColor",0x1000000)
oG2antt:SetProperty("Background",32/*exCursorHoverColumn*/,0x29000000)
oG2antt:SetProperty("Background",64/*exToolTipAppearance*/,0x1000000)
oG2antt:SetProperty("Background",18/*exSplitBar*/,0x1000000)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1546
|
Is there anyway to change the style of the splitter which separates the list/chart
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
oG2antt:SetProperty("Background",0/*exHeaderFilterBarButton*/,0x1000000)
oG2antt:SetProperty("Background",18/*exSplitBar*/,0x1ff0000)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1545
|
Does your control support subscript or superscript, in HTML captions

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,64)
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
h := oItems:AddItem("Item 1")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001","")
oItems:SetProperty("ItemBar",h,"",3/*exBarCaption*/,"<sha ;;0>Event <b><font ;6><off -6>2<off 4>3<off 4>1")
oItems:SetProperty("ItemBar",h,"",4/*exBarHAlignCaption*/,18)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1544
|
I have noticed that the column's header is changed once the cursor hovers it. Is it possible to change that visual appearance

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2")
oG2antt:SetProperty("BackColorHeader",0x1000000)
oG2antt:SetProperty("Background",32/*exCursorHoverColumn*/,0x12d86ff)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1543
|
Is it possible to change the visual appearance of the columns selector/floating bar(3)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oG2antt:VisualAppearance():Add(2,"c:\exontrol\images\normal.ebn")
oG2antt:VisualAppearance():Add(3,"c:\exontrol\images\pushed.ebn")
oG2antt:SetProperty("Background",92/*exColumnsFloatAppearance*/,0x2000000)
oG2antt:SetProperty("Background",87/*exColumnsFloatBackColor*/,0x3000000)
oG2antt:SetProperty("Background",93/*exColumnsFloatCaptionBackColor*/,AutomationTranslateColor( GraMakeRGBColor ( { 246,245,240 } ) , .F. ))
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1542
|
Is it possible to change the visual appearance of the columns selector/floating bar(2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oG2antt:VisualAppearance():Add(3,"c:\exontrol\images\pushed.ebn")
oG2antt:SetProperty("Background",87/*exColumnsFloatBackColor*/,0x3000000)
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1541
|
Is it possible to change the visual appearance of the columns selector/floating bar(1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:VisualAppearance():Add(2,"c:\exontrol\images\normal.ebn")
oG2antt:SetProperty("Background",92/*exColumnsFloatAppearance*/,0x2000000)
oG2antt:SetProperty("Background",87/*exColumnsFloatBackColor*/,AutomationTranslateColor( GraMakeRGBColor ( { 246,245,240 } ) , .F. ))
oG2antt:SetProperty("Background",93/*exColumnsFloatCaptionBackColor*/,AutomationTranslateColor( GraMakeRGBColor ( { 246,245,240 } ) , .F. ))
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1540
|
I am using the ColumnsFloatBarVisible property on True, but still not able to add any column on that list
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1539
|
Is it possible to list a column to columns selector/floating bar, but still user can use it

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oColumn := oColumns:Add("Column 3")
oColumn:Visible := .F.
oColumn:Enabled := .F.
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1538
|
How can I prevent a specific column not to be listed in the columns selector/floating bar
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oColumn := oColumns:Add("Column 3")
oColumn:Visible := .F.
oColumn:AllowDragging := .F.
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1537
|
Is it possible to change the "Columns" caption being shown in the columns selector/floating bar
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oG2antt:SetProperty("Description",26/*exColumnsFloatBar*/,"Hidden Columns")
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1536
|
How can I show the columns selector, so the user can drag and drop columns to the view
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ColumnAutoResize := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):Visible := .F.
oG2antt:ColumnsFloatBarVisible := -1/*exColumnsFloatBarVisibleIncludeHiddenColumns*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1535
|
The column's header is changed while the cursor hovers it. Is it possible to prevent that
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2")
oG2antt:SetProperty("Background",32/*exCursorHoverColumn*/,-1)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1534
|
Is there any property I can save and restore automatically the current setting, column position, size, and so on (2)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddItem("Item 1")
oItems:AddItem("Item 2")
oItems:AddItem("Item 3")
oG2antt:Layout := "Select=" + CHR(34) + "0" + CHR(34) + ";SingleSort=" + CHR(34) + "C0:2" + CHR(34) + ";Columns=1"
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1533
|
Is there any property I can save and restore automatically the current setting, column position, size, and so on (1)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddItem("Item 1")
oItems:AddItem("Item 2")
oItems:AddItem("Item 3")
oG2antt:Layout := "gBjAAwAAuABmABpABsAB0ABlAByhoAPIAOEPAA9gYABoABQAgUEg0XN4AOcJicKkpujMbjsfkMFk0YhkQgUOjUEl8gjcGO0ok8KMULjEaGMcj08kQAO8oMkTNEtGwAGQAqc7gUlhh1ABtAEsk9GpEfhElgVcsMupNlnlonlaAFcr0shUsp8QPEtnVJqJhmcIhUMh0QiU5sYAqMngUSuEMw07k8Qv0SgVRrNEuVflF2jF5x9JyNEm0TjQijemyE0jE3t+YruauoAu4Az1qj9BzRn0UzksSnAA0xDjY6qnAw8OiUQ0dwzN0zWz2t7j8/xURAGNvWH6k8xlEhklhEI0O/6QAgI="
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1532
|
How do I arrange my columns on multiple levels

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:ColumnAutoResize := .F.
oG2antt:DrawGridLines := -1/*exAllLines*/
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("C0")
oColumn:ExpandColumns := "1,2"
oColumn:DisplayExpandButton := .F.
oColumns:Add("C1")
oColumns:Add("C2")
oColumns:Add("C3")
oColumn1 := oColumns:Add("C4")
oColumn1:ExpandColumns := "5,6"
oColumn1:DisplayExpandButton := .F.
oColumns:Add("C5")
oColumn2 := oColumns:Add("C6")
oColumn2:ExpandColumns := "6,7"
oColumn2:DisplayExpandButton := .F.
oColumns:Add("C7")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1531
|
Does your control support expandable header or columns, so I can arrange it on multiple levels

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:DrawGridLines := -1/*exAllLines*/
oG2antt:SetProperty("BackColorLevelHeader",AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("Photo")
oColumn:AllowSizing := .F.
oColumn:Width := 32
oColumns:Add("Personal Info")
oColumns:Add("Title")
oColumns:Add("Name")
oColumns:Add("First")
oColumns:Add("Last")
oColumns:Add("Address")
oColumns:Item("Personal Info"):ExpandColumns := "2,3"
oColumn1 := oColumns:Item("Name")
oColumn1:ExpandColumns := "4,5"
oColumn1:Expanded := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1530
|
I need a Day/Hour Display where the Bars should be created/resized in a 15 Minute Scale in a normal View, but in a 5 Minute Scale when on an InsideZoom. How can I do that
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZoomFormat
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,128)
oChart:AllowCreateBar := 1/*exCreateBarAuto*/
oChart:UnitWidth := 50
oChart:FirstVisibleDate := "01/01/2013"
oChart:LevelCount := 2
oChart:Level(0):Label := 4096
oChart:Level(1):Label := "<%h%>:<%nn%>"
oChart:Level(1):Unit := 1048576/*exMinute*/
oChart:Level(1):Count := 60
oChart:ResizeUnitScale := 1048576/*exMinute*/
oChart:ResizeUnitCount := 15
oChart:AllowInsideZoom := .T.
oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
oInsideZoomFormat:InsideCount := 5
oInsideZoomFormat:InsideUnit := 1048576/*exMinute*/
oInsideZoomFormat:InsideLabel := "<%nn%>"
oItems := oG2antt:Items()
oItems:AddItem("Item")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1529
|
Can I change the format of date to be shown in the control
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
oColumns := oG2antt:Columns()
oColumns:Add("Default")
oColumn := oColumns:Add("Format.1")
oColumn:ComputedField := "%0"
oColumn:FormatColumn := "dateF(value) replace `/` with `-`"
oColumn1 := oColumns:Add("Format.2")
oColumn1:ComputedField := "%0"
oColumn1:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn1:FormatColumn := "`<b>`+ shortdate(value) + `</b> ` + timeF(value)"
oColumn2 := oColumns:Add("Format.3")
oColumn2:ComputedField := "%0"
oColumn2:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn2:FormatColumn := "` <b>`+ ( weekday(value) case ( 0 : `Su`; 1 : `Mo`; 2 : `Tu`; 3 : `We`; 4 : `Th`; 5 : `Fr`; 6 : `Sa`) ) + `</b> ` + ( dateF(value) replace `/` with `-` )"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001 10:00:00")
oItems:AddItem("01/02/2001 10:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1528
|
How can I display a text/caption on the chart part of the control

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL oNote,oNote1,oNote2
LOCAL oNotes
LOCAL h1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:AntiAliasing := .T.
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "12/26/2000"
oChart:SetProperty("PaneWidth",.F.,128)
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
h1 := oItems:AddItem("Item 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","A")
oItems:SetProperty("ItemBar",h1,"A",3/*exBarCaption*/,"text")
h1 := oItems:AddItem("Item 2")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","A")
oItems:SetProperty("ItemBar",h1,"A",3/*exBarCaption*/,"text outside associated with a bar")
oItems:SetProperty("ItemBar",h1,"A",4/*exBarHAlignCaption*/,18)
h1 := oItems:AddItem("Item 3")
oItems:AddBar(h1,"","01/02/2001","01/02/2001","A")
oItems:SetProperty("ItemBar",h1,"A",3/*exBarCaption*/,"text with no bar associated")
h1 := oItems:AddItem("Item 4")
oItems:AddBar(h1,"Task","01/02/2001","01/05/2001","A")
h1 := oItems:AddItem("Item 5")
h1 := oItems:AddItem("Item 6")
h1 := oItems:AddItem("Item 7")
h1 := oItems:AddItem("Item 8")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","A")
h1 := oItems:AddItem("Item 8")
oItems:AddBar(h1,"Task","01/02/2001","01/06/2001","A")
oNotes := oG2antt:Chart():Notes()
oNotes:Add("1S",oG2antt:Items:ItemByIndex(3),"A","<font ;6>Movable Note Inside the Bar"):SetProperty("PartCanMove",0/*exNoteStart*/,.T.)
oNotes:Add("AK",oG2antt:Items:ItemByIndex(6),"01/06/2001","Note associated with a date: <%mm%>/<%dd%>/<%yyyy%>")
oNote := oNotes:Add("2S",oG2antt:Items:ItemByIndex(7),"A","<font ;6>Fixed Note Left")
oNote:ShowLink := 0/*exNoteLinkHidden*/
oNote:SetProperty("PartVOffset",1/*exNoteEnd*/,0)
oNote:SetProperty("PartHOffset",0/*exNoteStart*/,-32)
oNote:SetProperty("PartShadow",1/*exNoteEnd*/,.F.)
oNote:SetProperty("PartBackColor",1/*exNoteEnd*/,AutomationTranslateColor( GraMakeRGBColor ( { 255,255,0 } ) , .F. ))
oNote1 := oNotes:Add("3S",oG2antt:Items:ItemByIndex(8),"A","Start<br><%mmm%> <%d%> <%yyyy%>")
oNote1:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.)
oNote1:SetProperty("PartHOffset",1/*exNoteEnd*/,-64)
oNote1:LinkStyle := 2/*exLinkDot*/
oNote1:LinkWidth := 2
oNote1:SetProperty("LinkColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. ))
oNote2 := oNotes:Add("3F",oG2antt:Items:ItemByIndex(8),"A","End<br><%mmm%> <%d%> <%yyyy%>")
oNote2:RelativePosition := 1
oNote2:SetProperty("PartCanMove",1/*exNoteEnd*/,.T.)
oNote2:LinkStyle := 2/*exLinkDot*/
oNote2:LinkWidth := 2
oNote2:SetProperty("LinkColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,255 } ) , .F. ))
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1527
|
Which is the best way of change Bar parent
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Debug := .T.
oG2antt:Chart():FirstVisibleDate := "01/01/2001"
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
h1 := oItems:AddItem("Item 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","A")
h2 := oItems:AddItem("Item 2")
oItems:AddBar(h2,"Task","01/03/2001","01/05/2001","B")
h3 := oItems:AddItem("Item 3")
oItems:AddBar(h3,"Task","01/05/2001","01/07/2001","A")
oItems:SetProperty("ItemBar",h3,"A",512/*exBarParent*/,h1)
DevOut( "The Bar A of H3 fails to change the parent to H1 as it has already a bar named A" )
oItems:SetProperty("ItemBar",h3,"A",512/*exBarParent*/,h2)
DevOut( "The Bar A of H3 can be moved to H2, as it contains no bars with the key A" )
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1526
|
Is it possible to have a bar in bar

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAEGg4BS4Dg6AADACAxRDAMgBQKAAzQFAYbBmGaGAAGIZhQgmFgAQhFcZQSKUOQTDKMIziYBYfgkMIgSbJUgDKAkRRdDSOYDmGQYDiCIoRShOMIjRLUXxtDYEIRkSZYJAKCTtBwJAAURRULR6ACUYDnSRqGj6CQKRqEVBSLAdKyXJKvaZhGIRSDUJZkWZEIyjBY8EzXNqrIDoGKqYgOQ4XV5TFgxPR9IyhEAaLrleT5TjOII/RpOEpYXSVHxFRAAAYhG4wABCXAAXjYF5Udhlfx3FCvMbqeCcSgOWoDZZRFa0PjVQQtNC4IitGzrMqrNaDSBlGigBauKw3TKlMzye7repOA5+aJGVz7VgfGz7EDjKg0GJcgMex3lOZB5jgPYHHMaYxjeRBilWbZNG4B49l2do6hkfIhECUhjDoHROEYUYMgEbQMCEEx+lGIY0CQUQJHYGoUgQGBFkgB4FmkOINiMbBrAwQoxngSQMCCYJAG8DYCkM" +;
"ZJNDOAhAHCbYGGGOBqByB5hiMcJSDORhwjQKoEkKSIgHoEZEDgWJOECSwyGSGwjkWUJUh8HADiiXA6CSRgQliFwcgcSICB2EJkCKDIAB4CAxDgMoOiOIkfA4CoiDCDhAmUEg4hEF4DHKCByA8JYpHIWwbAMIIuC6EIkCiOBwA2QpSHQbgOkoIZMD2GxmnmOhVhUJQiEwYAOAoQZQD6HhnjmaIfBuQ5BlQPQLiMEhuEKIRHmEKA7h+Q5ChQdQPmiahCg+JBnDAAhVCVPpoicHYEAobodicKZqHqGAO0YNA0ikQxKg6IYnAqAZcEGKxqnqOowiUZRSFwYwPAqIZkEOLhrjqaIqB4BAqn6QYwCwKwWkSMZECKLo6jKBA7DKTItWEZBlA8SpRmwRY1G0exYi0HoEEsbpdjcLZrgaYI4kQQo6laOYEFuIpojQCJiHAZgPksAZ0EePBvDuSp0j2bxrmadY+m8QpGnKP4EHwAwAjsCZxiQQQtAgAQrAiQowhKUB" +;
"/BIcJsEMD5EHETBPBYEhLFwJwZBKMY8G6bAoEaIQMjcIIEkzUZJAscgEEuShyjyKwskucpskQSwuDITJQEyTYzGuMIjBsBBCmiBATjObQDD+UB0E0DxGlCNINASO5PnSMQ7E2Uxu3CbQRguUgYFCVR1H0WxYC2R5xDSDgVWiXA8AyNggksXwPDWQQ3FgL4IHERxsluNpdj6bAqAacQckAEQBQWxfDzF4BUYYqBKhEEQNMDgPQGhFGIDgVwKR3iiCiIIIgig+BfA2MYOLtAqA4ESCYDIFgVDyGEKkPAQgFBDDwG4DYnQzg5GiDIOAZw3hCDoA8MQIA9PeGEHkRIyx6jiOMEoTAxRMhoCeIwUQKSbCKH6NgV43AECyFeEkEQdBTAxC0FESQYhgB+DGPcTwYBXBZEeCIOoKg5j6EIJAbQNxJCjCAMAJwDRxghA4DEBYpk1hnHwH4DIxg3AaFGGgMQFwHhBHgGkewhhCDIHMDkDY0AlAGEAIAgIA=")
oAppearance:Add(2,"c:\exontrol\images\normal.ebn")
oAppearance:Add(3,"CP:2 2 -4 2 4")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,256)
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oG2antt:Columns():Add("Info")
oItems := oG2antt:Items()
h := oItems:AddItem("Range Moveable Frame")
oItems:AddBar(h,"Task","01/04/2001","01/08/2001","F")
oItems:SetProperty("ItemBar",h,"F",6/*exBarToolTip*/,"This bar can be moved inside the displayed range.")
oItems:SetProperty("ItemBar",h,"F",22/*exBarMinStart*/,"01/02/2001")
oItems:SetProperty("ItemBar",h,"F",25/*exBarMaxEnd*/,"01/18/2001")
oItems:SetProperty("ItemBar",h,"F",26/*exBarShowRange*/,32)
oItems:SetProperty("ItemBar",h,"F",27/*exBarShowRangeTransparent*/,90)
h := oItems:AddItem("Range Moveable Pattern")
oItems:AddBar(h,"Task","01/06/2001","01/10/2001","F")
oItems:SetProperty("ItemBar",h,"F",6/*exBarToolTip*/,"This bar can be moved inside the displayed range.")
oItems:SetProperty("ItemBar",h,"F",22/*exBarMinStart*/,"01/02/2001")
oItems:SetProperty("ItemBar",h,"F",25/*exBarMaxEnd*/,"01/18/2001")
oItems:SetProperty("ItemBar",h,"F",26/*exBarShowRange*/,1)
oItems:SetProperty("ItemBar",h,"F",27/*exBarShowRangeTransparent*/,90)
h := oItems:AddItem("Range Moveable EBN Transparent")
oItems:AddBar(h,"Task","01/08/2001","01/12/2001","F")
oItems:SetProperty("ItemBar",h,"F",6/*exBarToolTip*/,"This bar can be moved inside the displayed range.")
oItems:SetProperty("ItemBar",h,"F",22/*exBarMinStart*/,"01/02/2001")
oItems:SetProperty("ItemBar",h,"F",25/*exBarMaxEnd*/,"01/18/2001")
oItems:SetProperty("ItemBar",h,"F",26/*exBarShowRange*/,16777216)
oItems:SetProperty("ItemBar",h,"F",27/*exBarShowRangeTransparent*/,50)
h := oItems:AddItem("Range Moveable EBN Opaque 1")
oItems:SetProperty("ItemHeight",h,24)
oItems:AddBar(h,"Task","01/10/2001","01/14/2001","F")
oItems:SetProperty("ItemBar",h,"F",6/*exBarToolTip*/,"This bar can be moved inside the displayed range.")
oItems:SetProperty("ItemBar",h,"F",22/*exBarMinStart*/,"01/02/2001")
oItems:SetProperty("ItemBar",h,"F",25/*exBarMaxEnd*/,"01/18/2001")
oItems:SetProperty("ItemBar",h,"F",26/*exBarShowRange*/,33554432)
h := oItems:AddItem("Range Moveable EBN Opaque 2")
oItems:SetProperty("ItemHeight",h,24)
oItems:AddBar(h,"Task","01/12/2001","01/16/2001","F")
oItems:SetProperty("ItemBar",h,"F",6/*exBarToolTip*/,"This bar can be moved inside the displayed range.")
oItems:SetProperty("ItemBar",h,"F",22/*exBarMinStart*/,"01/02/2001")
oItems:SetProperty("ItemBar",h,"F",25/*exBarMaxEnd*/,"01/18/2001")
oItems:SetProperty("ItemBar",h,"F",26/*exBarShowRange*/,50331648)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1525
|
How can I show vertical lines using the SelectDate

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAEGg4BK8IQAAYAQGKIYBkAKBQAGaAoDDYMwzQwAAxDMKEEwsACEIrjKCRShyCYZRhGcTAFD8EhhECTY4lCQJAiKLoeQLHMBybJ8LwiGQaRJmeaYRDUMI6QjPVARVIkaxhCSSaKpIAIBEB")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/01/2008"
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 2
oChart:AllowSelectDate := 0/*exNoSelectDate*/
oChart:SetProperty("MarkSelectDateColor",0x1000000)
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","01/15/2008",.T.)
oChart:SetProperty("SelectDate","01/18/2008",.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1524
|
How can I show vertical lines using the SelectDate

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/01/2008"
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 2
oChart:AllowSelectDate := 0/*exNoSelectDate*/
oChart:SetProperty("MarkSelectDateColor",0x7fff0000)
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","01/15/2008",.T.)
oChart:SetProperty("SelectDate","01/18/2008",.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1523
|
How can I find if there is any filter applied to the control
PROCEDURE OnFilterChange(oG2antt)
DevOut( "If negative, the filter is present, else not" )
DevOut( Transform(oG2antt:Items:VisibleItemCount(),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:FilterChange := {|| OnFilterChange(oG2antt)} /*Occurs when the filter was changed.*/
oG2antt:BeginUpdate()
oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
oG2antt:TreeColumnIndex := -1
oG2antt:FilterInclude := 4/*exMatchingItemsOnly*/
oColumn := oG2antt:Columns():Add("Column")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 240/*exFilter*/
oColumn:Filter := "C1"
oItems := oG2antt:Items()
h := oItems:AddItem("R1")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("R2")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oG2antt:ApplyFilter()
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1522
|
How can I prevent showing the lines for the hierarchy while using the exMatchingItemsOnly option
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
oG2antt:TreeColumnIndex := -1
oG2antt:FilterInclude := 4/*exMatchingItemsOnly*/
oColumn := oG2antt:Columns():Add("Column")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 240/*exFilter*/
oColumn:Filter := "C1|C2"
oItems := oG2antt:Items()
h := oItems:AddItem("R1")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("R2")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oG2antt:ApplyFilter()
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1521
|
Is there any method to get only the matched items and not the items with his parent
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
oG2antt:FilterInclude := 4/*exMatchingItemsOnly*/
oColumn := oG2antt:Columns():Add("Column")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 240/*exFilter*/
oColumn:Filter := "C1|C2"
oItems := oG2antt:Items()
h := oItems:AddItem("R1")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("R2")
oItems:InsertItem(h,,"C1")
oItems:InsertItem(h,,"C2")
oG2antt:ApplyFilter()
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1520
|
Is it possible to specify a working day exception that would override the non-working day pattern
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Pattern")
oChart := oG2antt:Chart()
oChart:FirstWeekDay := 1/*exMonday*/
oChart:FirstVisibleDate := "01/24/2008"
oChart:SetProperty("PaneWidth",.F.,52)
oChart:LevelCount := 2
oItems := oG2antt:Items()
oItems:AddItem("Default")
oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("1/26/2008"),.F.,"weekday(value) case (default:0 ; 0:1; 6:(value != #1/26/2008#))")
oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("1/27/2008"),.F.,"weekday(value) case (default:0 ; 0:(value != #1/27/2008#); 6:1)")
oItems:SetProperty("ItemNonworkingUnits",oItems:AddItem("Sundays"),.F.,"weekday(value) = 0")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1519
|
How do I enable the scrollbar-extension, as thumb to be shown outside of the control's client area
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:ScrollBars := 15/*exDisableBoth*/
oG2antt:Chart():ToolTip := ""
oG2antt:SetProperty("ScrollPartVisible",0/*exVScroll*/,65536/*exExtentThumbPart*/,.T.)
oG2antt:SetProperty("ScrollPartVisible",1/*exHScroll*/,65536/*exExtentThumbPart*/,.T.)
oG2antt:SetProperty("ScrollPartVisible",2/*exHChartScroll*/,65536/*exExtentThumbPart*/,.T.)
oG2antt:ScrollWidth := 4
oG2antt:SetProperty("Background",276/*exVSBack*/,AutomationTranslateColor( GraMakeRGBColor ( { 240,240,240 } ) , .F. ))
oG2antt:SetProperty("Background",260/*exVSThumb*/,AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. ))
oG2antt:ScrollHeight := 4
oG2antt:SetProperty("Background",404/*exHSBack*/,oG2antt:Background(276/*exVSBack*/))
oG2antt:SetProperty("Background",388/*exHSThumb*/,oG2antt:Background(260/*exVSThumb*/))
oG2antt:SetProperty("Background",511/*exScrollSizeGrip*/,oG2antt:Background(276/*exVSBack*/))
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1518
|
Is it possible to associate an extra frame, border, EBN to the bar/task

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(1,"gBFLBCJwBAEHhEJAEGg4BNACg6AADACAxRDAMgBQKAAzQFAYbhsGCGAAGEZBQgmFgAQhFcZQSKUOQTDKMIziYBYfgkMIgSbJUgDEAkRRdDSOYDmGQYDiCIoRShOMaTVJ8bQ2ASEaAmWK3boUAJFPrFc6ABJMZRRISXJABeKwRoGJYaUhRdDRNCIZBqEqua7iEZRQqCCZkWZPNTRVScByhF61IDpWjKLDKJJwXBMcxyBL0NRxFTAKawGoYbq0AJQVTQcZPVhgAYYfSlMDuOB5Gq+G5SQjhWIgBjde4dRrHYrsGyQAp7JJoWLZMQyFIFIYNTS8LgpPI6LyyP5rABhWw5PiUVyfWTMdwzPatbyKHJicbpepWPxcNYtNzcNb3SAbn+KgAmqP5yDiIAACIEhQDSGJOgcU4RhQYwgFUQwIESXxEGgbQJBQQhzHmUAAGILh0lWbpEGIIQQHuegaAaoRYBUBYBCgFAOAOQJgC4CgCCCQAUAQARACgRZFEa3ogCc" +;
"CICDCDZ9AeH5wGgFoHmAUBIA6CJgiALgMAIABYiYER+BuMIyC4CZjAcYgygyYxIlYNoNBGMJGDoCximiXg+g+Yx0G0DgNiOIJGECEZkgQbA7A8A5JA4SITmOZBsEGFJDkkLhQhXOItBYEZEGEHBCBARApGIYh1EAaIoAMQIEkENBNBGZpJg4YgCGcAAaGUAAFCmVhqBMZppGADQDACQAmAwAAFgoBh1BSJ4ZFwEEdHmcFmgWag2gEFhoFlINYkoHAQAABhKGQX4jGkGQ8BiJ5BDqBAABqKl1GSJxkgAcoqAYAR3lQcIrkaOoSiiEZCBCBAgiqAaJHaLpHBqQoliaBZxHwWYwkUQRMFQExEmENBJBIRIBAgQwQkOYJ0D4DhDgCYAzjWQpgjwLgKi2QIWl4CACADeofC4SpsHcHArlqRBqBkbpLAaQoxAUQRQE6PLoCaT40AOYJ6lWNdXlAL4/m2QIql4CRAAQBCAg=")
oAppearance:Add(2,"CP:1 -4 -4 4 4")
oG2antt:Columns():Add("Task")
oG2antt:DrawGridLines := -1/*exAllLines*/
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,128)
oChart:DrawGridLines := -1/*exAllLines*/
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Task"),"Task","01/02/2001","01/05/2001","K1")
h := oItems:AddItem("Task/ EBN Frame")
oItems:SetProperty("ItemHeight",h,32)
oItems:AddBar(h,"Task","01/03/2001","01/15/2001","K2")
oItems:SetProperty("ItemBar",h,"K2",51/*exBarFrameColor*/,33554432)
h := oItems:AddItem("Task/ EBN Frame")
oItems:SetProperty("ItemHeight",h,32)
oItems:AddBar(h,"Task","01/03/2001","01/15/2001","K2")
oItems:SetProperty("ItemBar",h,"K2",51/*exBarFrameColor*/,50331392)
oItems:AddBar(oItems:AddItem("Task"),"Task","01/02/2001","01/05/2001","K3")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1517
|
Is it possible to automatically display the working days duration in a column
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumn := oColumns:Add("Duration")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513)
oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A")
oColumn1 := oColumns:Add("Working")
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,258)
oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"A")
oG2antt:Items():AllowCellValueToItemBar := .T.
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,256)
oChart:FirstVisibleDate := "01/03/2002"
oChart:LevelCount := 2
oItems := oG2antt:Items()
h := oItems:AddItem("Task 1")
oItems:AddBar(h,"Task","01/04/2002","01/08/2002","A")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1516
|
How can I apply colors to columns section of the control based on properties of the displaying bars

PROCEDURE OnBarResize(oG2antt,Item,Key)
oG2antt:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn,oColumn1
LOCAL oConditionalFormat
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BarResize := {|Item,Key| OnBarResize(oG2antt,Item,Key)} /*Occurs when a bar is moved or resized.*/
oG2antt:BeginUpdate()
oColumn := oG2antt:Columns():Add("<fgcolor=FF0000>Tasks > 2 days")
oColumn:HTMLCaption := oColumn:Caption()
oColumn1 := oG2antt:Columns():Add("PropertyBar")
oColumn1:Visible := .F.
oColumn1:SetProperty("Def",19/*exCellValueToItemBarKey*/,"")
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513)
oG2antt:Items():AllowCellValueToItemBar := .T.
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,96)
oChart:NonworkingDays := 0
oConditionalFormat := oG2antt:ConditionalFormats():Add("%1 > 2")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oConditionalFormat:Bold := .T.
oG2antt:SetProperty("SelBackColor",oG2antt:BackColor())
oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor())
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2001","01/07/2001","")
oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1515
|
Is it possible to update the colors on columns caption to highlight the critical path ( CPM )

PROCEDURE OnBarResize(oG2antt,Item,Key)
oG2antt:Items():SchedulePDM(Item,Key)
oG2antt:Refresh()
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn
LOCAL oConditionalFormat
LOCAL oItems
LOCAL h1,h2,h3,h4
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BarResize := {|Item,Key| OnBarResize(oG2antt,Item,Key)} /*Occurs when a bar is moved or resized.*/
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oColumn := oG2antt:Columns():Add("PropertyBar")
oColumn:Visible := .F.
oColumn:SetProperty("Def",19/*exCellValueToItemBarKey*/,"")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,269)
oG2antt:Items():AllowCellValueToItemBar := .T.
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,48)
oChart:NonworkingDays := 0
oConditionalFormat := oG2antt:ConditionalFormats():Add("%1 != 0")
oConditionalFormat:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oConditionalFormat:Bold := .T.
oG2antt:SetProperty("SelBackColor",oG2antt:BackColor())
oG2antt:SetProperty("SelForeColor",oG2antt:ForeColor())
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","01/02/2001","01/04/2001","")
oItems:AddLink("L1",h1,"",h2,"")
h3 := oItems:AddItem("Task 3")
oItems:AddBar(h3,"Task","01/02/2001","01/04/2001","")
oItems:AddLink("L2",h2,"",h3,"")
h4 := oItems:AddItem("Task 3")
oItems:AddBar(h4,"Task","01/02/2001","01/03/2001","")
oItems:AddLink("L3",h2,"",h4,"")
oItems:SetProperty("DefSchedulePDM",5/*exPDMCriticalPathBarColor*/,255)
oItems:SetProperty("DefSchedulePDM",7/*exPDMCriticalPathLinkColor*/,255)
oItems:SchedulePDM(0,"")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1514
|
I am using the AddShapeCorner to define icon-bars. Is it possible to define with a different color

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar,oBar1,oBar2
LOCAL oBars
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,128)
oBars := oChart:Bars()
oBars:AddShapeCorner(12345,1)
oBar := oBars:CallMethod("Copy","Milestone","Original")
oBar:StartShape := 12345/*0x3020+exShapeIconVBar+exShapeIconRight*/
oBar:SetProperty("StartColor",-1)
oBar1 := oBars:CallMethod("Copy","Milestone","Red")
oBar1:StartShape := 12345/*0x3020+exShapeIconVBar+exShapeIconRight*/
oBar1:SetProperty("StartColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBar2 := oBars:CallMethod("Copy","Milestone","Green")
oBar2:StartShape := 12345/*0x3020+exShapeIconVBar+exShapeIconRight*/
oBar2:SetProperty("StartColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Original"),"Original","01/02/2001","01/02/2001")
oItems:AddBar(oItems:AddItem("Red"),"Red","01/02/2001","01/02/2001")
oItems:AddBar(oItems:AddItem("Green"),"Green","01/02/2001","01/02/2001")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1513
|
My icon-bars shows different when displaying in the chart. Any ideas
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar
LOCAL oBars
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oG2antt:Chart():FirstVisibleDate := "01/01/2001"
oBars := oG2antt:Chart():Bars()
oBars:AddShapeCorner(12345,1)
oBar := oBars:Item("Milestone")
oBar:StartShape := 12345/*0x3020+exShapeIconVBar+exShapeIconRight*/
oBar:SetProperty("StartColor",-1)
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Milestone","01/02/2001","01/02/2001")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1512
|
The items are not colored in the chart panel

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Chart():SetProperty("PaneWidth",.F.,128)
oG2antt:Columns():Add("Default")
oItems := oG2antt:Items()
h := oItems:AddItem("Item")
oG2antt:Chart():SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oG2antt:Items():SetProperty("ItemBackColor",h,AutomationTranslateColor( GraMakeRGBColor ( { 0,255,0 } ) , .F. ))
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1511
|
I need to know how to determine the critical path (CPM) after the SchedulePDM procedure, so I can turn red the bars and links

PROCEDURE OnBarResize(oG2antt,Item,Key)
oG2antt:Items():SchedulePDM(Item,Key)
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h1,h2,h3,h4
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BarResize := {|Item,Key| OnBarResize(oG2antt,Item,Key)} /*Occurs when a bar is moved or resized.*/
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,48)
oChart:NonworkingDays := 0
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","K1")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","01/02/2001","01/04/2001","K2")
oItems:AddLink("L1",h1,"K1",h2,"K2")
h3 := oItems:AddItem("Task 3")
oItems:AddBar(h3,"Task","01/02/2001","01/04/2001","K3")
oItems:AddLink("L2",h2,"K2",h3,"K3")
h4 := oItems:AddItem("Task 3")
oItems:AddBar(h4,"Task","01/02/2001","01/03/2001","K4")
oItems:AddLink("L3",h2,"K2",h4,"K4")
oItems:SetProperty("DefSchedulePDM",5/*exPDMCriticalPathBarColor*/,255)
oItems:SetProperty("DefSchedulePDM",7/*exPDMCriticalPathLinkColor*/,255)
oItems:SchedulePDM(0,"K1")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1510
|
How can I display the Year in Thai, Buddhist, Korean format

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oLevel
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:FirstWeekDay := oChart:LocFirstWeekDay()
oChart:MonthNames := oChart:LocMonthNames()
oChart:WeekDays := oChart:LocWeekDays()
oChart:AMPM := oChart:LocAMPM()
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,0)
oChart:UnitScale := 4096/*exDay*/
oLevel := oChart:Level(0)
oLevel:Label := "<%mmmm%> <%d%>, <%loc_yyyy%> <r><%ww%>"
oLevel:Unit := 256/*exWeek*/
oLevel:ToolTip := oLevel:Label()
oChart:ToolTip := "<%ddd%> <%m%>/<%d%>/<%loc_yyyy%>"
oG2antt:SetProperty("Description",17/*exFilterBarDateMonths*/,oG2antt:Chart:MonthNames())
oG2antt:SetProperty("DefaultEditorOption",30/*exDateMonths*/,oG2antt:Chart:MonthNames())
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1509
|
How does localization work

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:FirstWeekDay := oChart:LocFirstWeekDay()
oChart:MonthNames := oChart:LocMonthNames()
oChart:WeekDays := oChart:LocWeekDays()
oChart:AMPM := oChart:LocAMPM()
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,0)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1508
|
Is it possible to show the bars with a different brightness (2)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(1,"C:/Program Files/Exontrol/ExG2antt/Sample/EBN/2task--.ebn")
oAppearance:Add(2,"C:/Program Files/Exontrol/ExG2antt/Sample/EBN/2task-.ebn")
oAppearance:Add(3,"C:/Program Files/Exontrol/ExG2antt/Sample/EBN/2task.ebn")
oAppearance:Add(4,"C:/Program Files/Exontrol/ExG2antt/Sample/EBN/2task+.ebn")
oAppearance:Add(5,"C:/Program Files/Exontrol/ExG2antt/Sample/EBN/2task++.ebn")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,128)
oChart:NonworkingDays := 0
oChart:Bars():CallMethod("Copy","Task","--"):SetProperty("Color",0x1000000)
oChart:Bars():CallMethod("Copy","Task","-"):SetProperty("Color",0x2000000)
oChart:Bars:Item("Task"):SetProperty("Color",0x3000000)
oChart:Bars():CallMethod("Copy","Task","+"):SetProperty("Color",0x4000000)
oChart:Bars():CallMethod("Copy","Task","++"):SetProperty("Color",0x5000000)
oG2antt:Columns():Add("Brightness")
oItems := oG2antt:Items()
h := oItems:AddItem("0%")
oItems:AddBar(h,"--","01/02/2001","01/04/2001","--")
oItems:AddBar(h,"-","01/05/2001","01/07/2001","-")
oItems:AddBar(h,"Task","01/08/2001","01/10/2001","")
oItems:AddBar(h,"+","01/11/2001","01/13/2001","+")
oItems:AddBar(h,"++","01/14/2001","01/16/2001","++")
h := oItems:AddItem("25%")
oItems:AddBar(h,"--","01/02/2001","01/04/2001","--")
oItems:AddBar(h,"-","01/05/2001","01/07/2001","-")
oItems:AddBar(h,"Task","01/08/2001","01/10/2001","")
oItems:AddBar(h,"+","01/11/2001","01/13/2001","+")
oItems:AddBar(h,"++","01/14/2001","01/16/2001","++")
oItems:SetProperty("ItemBar",h,"<*>",19/*exBarTransparent*/,25)
h := oItems:AddItem("50%")
oItems:AddBar(h,"--","01/02/2001","01/04/2001","--")
oItems:AddBar(h,"-","01/05/2001","01/07/2001","-")
oItems:AddBar(h,"Task","01/08/2001","01/10/2001","")
oItems:AddBar(h,"+","01/11/2001","01/13/2001","+")
oItems:AddBar(h,"++","01/14/2001","01/16/2001","++")
oItems:SetProperty("ItemBar",h,"<*>",19/*exBarTransparent*/,50)
h := oItems:AddItem("75%")
oItems:AddBar(h,"--","01/02/2001","01/04/2001","--")
oItems:AddBar(h,"-","01/05/2001","01/07/2001","-")
oItems:AddBar(h,"Task","01/08/2001","01/10/2001","")
oItems:AddBar(h,"+","01/11/2001","01/13/2001","+")
oItems:AddBar(h,"++","01/14/2001","01/16/2001","++")
oItems:SetProperty("ItemBar",h,"<*>",19/*exBarTransparent*/,75)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1507
|
Is it possible to show the bars with a different brightness (1)

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
oChart := oG2antt:Chart()
oChart:Bars:Item("Task"):SetProperty("Color",0x1000000)
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,128)
oG2antt:Columns():Add("Brightness")
oItems := oG2antt:Items()
h := oItems:AddItem("0%")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
h := oItems:AddItem("25%")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",19/*exBarTransparent*/,25)
h := oItems:AddItem("50%")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",19/*exBarTransparent*/,50)
h := oItems:AddItem("75%")
oItems:AddBar(h,"Task","01/02/2001","01/04/2001")
oItems:SetProperty("ItemBar",h,"",19/*exBarTransparent*/,75)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1506
|
So the behavior I am looking for is that a change can cascade through a bar's successors, but a change that would affect a bar's predecessors is not allowed. Is this possible to in ExG2antt

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h,h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:OnResizeControl := 1/*exResizeChart*/
oG2antt:Columns():Add("Tasks")
oG2antt:Columns():Add("Start"):Visible := .F.
oG2antt:Columns():Add("End"):Visible := .F.
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "09/18/2006"
oChart:SetProperty("PaneWidth",.F.,64)
oChart:SetProperty("ScrollRange",0/*exStartDate*/,oChart:FirstVisibleDate())
oChart:SetProperty("ScrollRange",1/*exEndDate*/,"12/31/2006")
oChart:SetProperty("MarkSelectDateColor",0x7fff0000)
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","09/19/2006",.T.)
oChart:AllowCreateBar := 0/*exNoCreateBar*/
oChart:AllowLinkBars := .F.
oItems := oG2antt:Items()
h := oItems:AddItem("Project")
oItems:SetProperty("CellValue",h,1,"09/21/2006")
oItems:SetProperty("CellValue",h,2,"10/03/2006")
oItems:AddBar(h,"Summary",oItems:CellValue(h,1),oItems:CellValue(h,2),"sum")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("CellValue",h1,1,oItems:CellValue(h,1))
oItems:SetProperty("CellValue",h1,2,"09/24/2006")
oItems:AddBar(h1,"Task",oItems:CellValue(h1,1),oItems:CellValue(h1,2),"K1")
oItems:SetProperty("ItemBar",h1,"K1",22/*exBarMinStart*/,"09/20/2006")
h2 := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellValue",h2,1,oItems:CellValue(h1,2))
oItems:SetProperty("CellValue",h2,2,"09/28/2006")
oItems:AddBar(h2,"Unknown",oItems:CellValue(h2,1),oItems:CellValue(h2,2),"K2")
oItems:AddLink("L1",h1,"K1",h2,"K2")
h3 := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellValue",h3,1,oItems:CellValue(h2,2))
oItems:SetProperty("CellValue",h3,2,oItems:CellValue(h,2))
oItems:AddBar(h3,"Task",oItems:CellValue(h3,1),oItems:CellValue(h3,2),"K3")
oItems:AddLink("L2",h2,"K2",h3,"K3")
oItems:GroupBars(h1,"K1",.F.,h2,"K2",.T.,31,"0;4")
oItems:GroupBars(h2,"K2",.F.,h3,"K3",.T.,31,"0;2")
oItems:DefineSummaryBars(h,"sum",h1,"K1")
oItems:DefineSummaryBars(h,"sum",h2,"K2")
oItems:DefineSummaryBars(h,"sum",h3,"K3")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("ItemBold",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1505
|
How can I have a case-insensitive filter (exFilterDoCaseSensitive flag is not set)
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
oG2antt:MarkSearchColumn := .F.
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("Car")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 240/*exFilter*/
oColumn:Filter := "MAZDA"
oColumn1 := oColumns:Add("Equipment")
oColumn1:DisplayFilterButton := .T.
oColumn1:DisplayFilterPattern := .F.
oColumn1:CustomFilter := "Air Bag||*Air Bag*|||Air condition||*Air condition*|||ABS||*ABS*|||ESP||*ESP*"
oColumn1:FilterType := 3/*exPattern*/
oColumn1:Filter := "AIR BAG"
oItems := oG2antt:Items()
oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag")
oItems:SetProperty("CellValue",oItems:AddItem("Toyota"),1,"Air Bag,Air condition")
oItems:SetProperty("CellValue",oItems:AddItem("Ford"),1,"Air condition")
oItems:SetProperty("CellValue",oItems:AddItem("Nissan"),1,"Air Bag,ABS,ESP")
oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag, ABS,ESP")
oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"ABS,ESP")
oG2antt:ApplyFilter()
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1504
|
How can I have a case-sensitive filter
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Chart():SetProperty("PaneWidth",.T.,0)
oG2antt:MarkSearchColumn := .F.
oColumns := oG2antt:Columns()
oColumn := oColumns:Add("Car")
oColumn:DisplayFilterButton := .T.
oColumn:FilterType := 496/*exFilterDoCaseSensitive+exFilter*/
oColumn:Filter := "Mazda"
oColumn1 := oColumns:Add("Equipment")
oColumn1:DisplayFilterButton := .T.
oColumn1:DisplayFilterPattern := .F.
oColumn1:CustomFilter := "Air Bag||*Air Bag*|||Air condition||*Air condition*|||ABS||*ABS*|||ESP||*ESP*"
oColumn1:FilterType := 259/*exFilterDoCaseSensitive+exPattern*/
oColumn1:Filter := "Air Bag"
oItems := oG2antt:Items()
oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag")
oItems:SetProperty("CellValue",oItems:AddItem("Toyota"),1,"Air Bag,Air condition")
oItems:SetProperty("CellValue",oItems:AddItem("Ford"),1,"Air condition")
oItems:SetProperty("CellValue",oItems:AddItem("Nissan"),1,"Air Bag,ABS,ESP")
oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"Air Bag, ABS,ESP")
oItems:SetProperty("CellValue",oItems:AddItem("Mazda"),1,"ABS,ESP")
oG2antt:ApplyFilter()
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1503
|
Is it possible to add a custom label to the days with a specified background color

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:SetProperty("PaneWidth",.F.,48)
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"","01/02/2001","01/08/2001","K1","Leave Blank")
oItems:SetProperty("ItemBar",h1,"K1",29/*exBarSelectable*/,.F.)
oItems:SetProperty("ItemBar",h1,"K1",7/*exBarBackColor*/,255)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1502
|
What is the event fired when I change "...Chart.PaneWidthLeft" (or "...Chart.PaneWidthRight") in the Gantt splitter window
PROCEDURE OnChartEndChanging(oG2antt,Operation)
DevOut( "End Operation(exVSplitterChange(10)" )
DevOut( Transform(Operation,"") )
DevOut( "PaneWidth:" )
DevOut( Transform(oG2antt:Chart:PaneWidth(.F.),"") )
RETURN
PROCEDURE OnChartStartChanging(oG2antt,Operation)
DevOut( "Start Operation(exVSplitterChange(10)" )
DevOut( Transform(Operation,"") )
DevOut( "PaneWidth:" )
DevOut( Transform(oG2antt:Chart:PaneWidth(.F.),"") )
RETURN
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ChartEndChanging := {|Operation| OnChartEndChanging(oG2antt,Operation)} /*Occurs after the chart has been changed.*/
oG2antt:ChartStartChanging := {|Operation| OnChartStartChanging(oG2antt,Operation)} /*Occurs when the chart is about to be changed.*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
1501
|
I want to ask if I can select more than one bar in the chart and move them together

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "12/29/2000"
oChart:SetProperty("PaneWidth",.F.,64)
oChart:LevelCount := 2
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2001","01/04/2001","K1")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2001","01/06/2001","K2")
oItems:AddBar(oItems:AddItem("Task 3"),"Task","01/08/2001","01/10/2001","K3")
h := oItems:AddItem("")
oItems:AddBar(h,"","01/08/2001","01/10/2001","","<b>Right click</b> the chart, start dragging to select multiple bars<br>or click a bar while pressing the <b>CTRL</b> key")
oItems:SetProperty("ItemHeight",h,36)
oItems:SetProperty("ItemBar",h,"",29/*exBarSelectable*/,.F.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|